import service from "@/service";

//风险源管理-过程+危险源 下拉框
export function getListAreaAndName() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/listAreaAndName`,
    method: "POST",
    data: {
      changeName: "",
      changeProcess: "",
    },
  });
}

// 风险源管理-列表
export function getManageList(data) {
  let { zhgdDeptCode, changeName, changeProcess, page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/getList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      zhgdDeptCode,
      changeName,
      changeProcess,
    },
  });
}
// 风险源管理-按钮权限
export function dangerManageButton(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/showButton`,
    method: "GET",
    params,
  });
}

//风险源管理-GIS地图
export function getDangerousGisList(data) {
  let { changeProcess = "", id = "", zhgdDeptCode = "", page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/getGisList?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: {
      changeProcess,
      zhgdDeptCode,
      id,
    },
  });
}
//风险源管理-新增
export function getDangerManageAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/addData`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}
//风险源管理-编辑
export function getDangerManageUpdate(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/updateData`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}

//风险源管理-详情
export function getDangerManageDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/getDetail?id=${id}`,
    method: "POST",
  });
}
//风险源管理-删除
export function getDangerManageDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/deleteData?id=${id}`,
    method: "POST",
  });
}

//风险源管理-关闭
export function getSwitchById(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/editByIds`,
    method: "POST",
    data,
  });
}
//风险源管理-台账导出
export function downloadDangerManageExcel(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/api/exportExcelByDeptId`,
    method: "GET",
    apiType: "file",
    responseType: "arraybuffer",
    params,
  });
}

//风险源管理-检查记录-列表
export function getRiskCheckList(data) {
  let { dangerId, page, pageSize } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/getDangerCheckList?page=${page}&pageSize=${pageSize}&dangerId=${dangerId}`,
    method: "POST",
  });
}

//风险源管理-检查记录-新增
export function getCheckSave(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/saveDangerCheck`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}

//风险源管理-检查记录-详情
export function getRiskCheckDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/getDangerCheckDetail?id=${id}`,
    method: "POST",
  });
}
//风险源管理-检查记录-删除
export function getCheckDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdDangerManage/deleteDangerCheckData?id=${id}`,
    method: "POST",
  });
}

//安全抓拍-列表
export function getSnapList(data) {
  let { page, pageSize, zhgdDeptCode, startTime, endTime } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSnap/list?page=${page}&pageSize=${pageSize}`,
    method: "POST",
    data: { zhgdDeptCode, startTime, endTime },
  });
}

//安全抓拍-详情
export function getSnapDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSnap/detail?id=${id}`,
    method: "POST",
  });
}

//安全抓拍-审批记录
export function getSnapRecord(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSnap/approveRecord?id=${id}`,
    method: "POST",
  });
}
//安全抓拍-分配-人员类型下拉列表
export function selectDept() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSnap/selectDept`,
    method: "POST",
  });
}

//安全抓拍-分配 处理 审批
export function getSnapApprove(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdSnap/approveData`,
    method: "POST",
    data,
  });
}

//安全抓拍-附件上传
export function snapUploadFile(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/configFile/uploadFiles`,
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}

//下载附件
export function filePath(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/configFile/getFilePath?id=` + id,
    method: "GET",
  });
}

//视频管理
//视频管理-根节点-列表
export function getZhgdVideoNodeList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideoNode/getNodeList`,
    method: "POST",
    data,
  });
}

//视频管理-根节点-删除
export function getZhgdVideoNodeDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideoNode/deleteData?id=${id}`,
    method: "POST",
  });
}

//视频管理-视频-删除
export function getZhgdVideoDelete(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/deleteData?id=${id}`,
    method: "POST",
  });
}

//视频管理-视频-详情
export function getZhgdVideoDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/getDetail?id=${id}`,
    method: "POST",
  });
}

//视频管理-控制高清/流畅
export function setProjectVideo(type) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/setProjectVideo?type=${type}`,
    method: "POST",
  });
}

//视频管理-高清/流畅权限查询
export function getProjectVideoConfig() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/getProjectVideoConfig`,
    method: "GET",
  });
}

//视频管理-右侧视频-旋转角度权限
export function getAdjustAngle(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/getAdjustAngle`,
    method: "GET",
    params,
  });
}

//视频管理-视频角度权限
export function superUserFlag() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-user/superUserFlag`,
    method: "GET",
  });
}

//按权限查询所有标段
export function getAllSecList() {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/commonMethod/getAllQxSecs`,
    method: "POST",
  });
}

//根据dickey查询该租户下数据
export function getDickeyList(parameter) {
  let { dictKey = "userType", extension1, module } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/configDictData/getDataByDictKey`,
    method: "POST",
    data: {
      dictKey,
      extension1,
      module,
    },
  });
}

//设置视频预置位
export function setVideoIntdata(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/updateIntdata`,
    method: "GET",
    params,
  });
}

//视频管理-根节点-新增
export function getZhgdVideoNodeAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideoNode/addOrUpdateData`,
    method: "POST",
    data,
  });
}

//视频管理-根节点-详情
export function getZhgdVideoNodeDetail(id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideoNode/getDetail?id=${id}`,
    method: "POST",
  });
}

//视频管理-视频-新增
export function getZhgdVideoAdd(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/addOrUpdateData`,
    method: "POST",
    data,
  });
}

//视频管理-分配人员
export function getVideoUserList(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/zhgdVideo/getUserGroupList`,
    method: "POST",
    data,
  });
}
